<template>
  <div>
    <el-dialog title="药品详情" :visible.sync="show" width="800px" append-to-body>
      <el-form ref="info" :model="info" label-width="100px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="药品名称" prop="medicineName">
              {{ info.medicineName }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="条码" prop="barCode">
              {{ info.barCode }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="品种" prop="variety">
              <dict-tag :options="mc_medicine_variety_type" :value="info.variety" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="处方分类" prop="prescriptionType">
              <dict-tag
                :options="mc_prescription_type"
                :value="info.prescriptionType"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="生产厂家" prop="manufacturer">
              {{ info.manufacturer }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="药品规格" prop="medicineSpecifications">
              {{ info.medicineSpecifications }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保质期" prop="qualityGuaranteePeriod">
              {{ info.qualityGuaranteePeriod || "-" }}月
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="包装规格" prop="packagingSpecifications">
              {{ info.packagingSpecifications }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="库存" prop="inventory">
              {{ info.inventory }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="新特药" prop="newSpecial">
              {{ info.newSpecial == 1 ? "是" : info.newSpecial == 0 ? "否" : "" }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="基药" prop="baseDrug">
              {{ info.baseDrug == 1 ? "是" : info.baseDrug == 0 ? "否" : "" }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="社保" prop="socialSecurity">
              {{ info.socialSecurity == 1 ? "是" : info.socialSecurity == 0 ? "否" : "" }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="单位" prop="unit">
              <dict-tag :options="mc_medicine_unit" :value="info.unit" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="剂型" prop="dosageForm">
              <dict-tag :options="mc_dosage_form" :value="info.dosageForm" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="产地" prop="origin">
              {{ info.origin }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="停产" prop="stopProduction">
              {{ info.stopProduction == 1 ? "是" : info.stopProduction == 0 ? "否" : "" }}
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: "UserForm",
  props: {
    value: {
      type: Boolean,
      default: false,
    },
    info: {
      type: Object,
      default: () => {},
    },
    mc_prescription_type: {
      type: Array,
      default: () => [],
    },
    mc_medicine_variety_type: {
      type: Array,
      default: () => [],
    },
    mc_medicine_unit: {
      type: Array,
      default: () => [],
    },
    mc_dosage_form: {
      type: Array,
      default: () => [],
    },
  },
  computed: {
    show: {
      get() {
        return this.value;
      },
      set(val) {
        this.$emit("input", val);
      },
    },
  },
};
</script>
